<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<div layout="column">
  <kd-secret-info secret="::$ctrl.secretDetail"></kd-secret-info>
  <kd-info-card>
    <kd-info-card-header>[[Data|Secrets info details section data.]]</kd-info-card-header>
    <kd-info-card-section>
      <div layout="row"
           class="kd-info-card-entry kd-secret-detail-row"
           ng-repeat="(key, value) in ::$ctrl.secretDetail.data">
        <div flex="nogrow"
             style="position: relative">
          <md-button ng-click="isActive = !isActive"
                     class="md-icon-button">
            <md-icon md-font-library="material-icons"
                     ng-if="isActive">
              visibility_off
            </md-icon>
            <md-icon md-font-library="material-icons"
                     ng-if="!isActive">
              visibility
            </md-icon>
            <md-tooltip md-delay="500"
                        md-autohide
                        ng-if="!isActive">
              [[Show secret content|Tooltip label for showing secret content]]
            </md-tooltip>
            <md-tooltip md-delay="500"
                        md-autohide
                        ng-if="isActive">
              [[Hide secret content|Tooltip label for hiding secret content]]
            </md-tooltip>
          </md-button>

          {{::key}}:
        </div>
        <div class="kd-info-card-entry-content">
          <kd-toggle-hidden-text active="isActive"
                                 placeholder="[[{{::$ctrl.formatDataValue(value).length}} bytes | Secrets info details section bytes.]]"
                                 text="{{::$ctrl.formatDataValue(value)}}">
          </kd-toggle-hidden-text>
        </div>
      </div>
    </kd-info-card-section>
  </kd-info-card>
</div>
